import { getToplist, getCatList } from '../../api/services/api'
export default ({
    namespaced: true,
    state: {
        cloudRankingList: [],
        worldRankingList: []
    },
    mutations: {
        changRankingList(state, val) {
            state.cloudRankingList = val.slice(0, 4);
            state.worldRankingList = val.slice(5,);
        }
    },
    actions: {
        async getToplist(context, val) {
            const data = await getToplist();
            console.log('全部排行榜', data);
            context.commit('changRankingList', data.list);
        },


    },

})
